﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CDB.LinqModel.Data;
using CDB.LinqData;
using System.Web.UI.HtmlControls;

public partial class Clients : System.Web.UI.Page
{
    #region Variable Declaration

    private IDataRepository _dataObject = new DataRepository();
    private CDB.LinqModel.Content content;

    #endregion

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindPages();
        }
    }
    private void BindPages()
    {
        content = new CDB.LinqModel.Content(_dataObject);
        content.PageName = "clients";
        content.getContentByPageName();

        if (content.Id != 0)
        {
            pageText.InnerText = content.PageTitle;
            ltrContent.Text = Server.HtmlDecode(content.PageContent);

            HtmlMeta meta = new HtmlMeta();
            meta.Name = "keyword";
            meta.Content = content.MetaKeyword;
            Header.Controls.Add(meta);

            meta = new HtmlMeta();
            meta.Name = "description";
            meta.Content = content.MetaDescription;
            Header.Controls.Add(meta);

            Title = content.PageTitle;
        }
    }
}